<?php

class CourseController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        $course=new Application_Form_Course();
        $this->view->course=$course;
          $courseModel=new Application_Model_Course();
                        
            	$data = $courseModel->getCoursesByCategory(3);                
                $this->view->data = Zend_Json::encode($data);
              $course->populate($data);
              //  print_r($data);
               
                
        
    }

    public function getcoursesAction()
    {
        
    }

    public function getcourseCategoryAction()
    {
        // action body
    }

    public function getcitiesajaxAction()
    {
                $courseModel=new Application_Model_Course();
                        
            	$data = $courseModel->getCoursesByCategory(3);                
                    
                $this->view->data = Zend_Json::encode($data);	
        
        
        /*  $this->_helper->layout->disableLayout ();
                $this->_response->setHeader('Content-Type', 'application/json'); 
                $this->view->json = array( 
                     'status' => 'ok', 
                     'message' => 'This is a status message.', 
                        ); 
		$this->_helper->viewRenderer->setNoRender ();
		$categoryId = $this->getRequest()->getParam ('4');
		$courseModel = new Application_Model_Course();
		$coursesArr = $courseModel->getCoursesByCategory($categoryId);
		foreach ( $coursesArr as $course )
		{
			echo $course ['course_name'] . "<br>";
		}*/
    }


}





